package huanzhao.erp.mapper;

import huanzhao.erp.domain.entity.Exception;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import javax.validation.constraints.NotBlank;

public interface ExceptionMapper extends BaseMapper<Exception> {

    boolean existsByTaskAndType(@Param("taskId") long taskId, @Param("type") String type);

    /**
     * 获取员工接收到的并正在处理异常的数量
     *
     * @param staffId 员工id
     * @return int
     * 2024/10/12 16:35:38
     */
    int getStaffHandlingExceptionsNum(@Param("staffId") long staffId);

    /**
     * 完成异常处理
     *
     * @param exceptionId 异常id
     * @param approve     是否批准
     * @param response    处理结果
     * @return void
     * 2024/10/12 18:15:05
     */
    void finish(@Param("exceptionId") long exceptionId, @Param("approve") boolean approve, @NotBlank @Param("response") String response);
}




